<?php 
	include($_SERVER['DOCUMENT_ROOT']."/headerins.php");
	include($_SERVER['DOCUMENT_ROOT']."/headerFrame.php");
?>

<?php
echo '
        <div id="contextCaption">Партнеры.</div>
        <hr>
            <table border="0" id="contextGrid" cellspacing="0">
                <thead>
                    <tr>
                        <th>id</th>
                        <th>№</th>
                        <th>№2</th>
                        <th>e-mail</th>
                        <th>Фамилия</th>
                        <th>Имя</th>                        
                       <th>Акт</th>        
					   <th>Изм</th>
					   <th>Уд</th>					   
                    </tr>
                </thead>
                <tbody>
';
?>
                <?php


                          $sql = '
                        	SELECT
                                    id, number, parentnumber
                                    ,email	,name   ,lastname
                                    ,middlename, createdt, lastenterdt
                                    ,active				
                                FROM users                          
                          ';
                          $result = mysql_query($sql);
                            if (!$result) {
                                echo 'Ошибка запроса: ' . mysql_error();
                                exit;
                            }
                          while($row = mysql_fetch_array($result)){
                              echo "<tr>";
                              echo "<td> " .$row['id']. "</td>";
                              echo "<td> " .$row['number'] . "</td>";
                              echo "<td> " . $row['parentnumber'] . "</td>";
							  echo "<td> " . $row['email'] . "</td>";                              
                              echo "<td> " . $row['lastname'] . "</td>";                              
                              echo "<td> " . $row['name'] . "</td>";                                                           
                              echo "<td> " . $row['active'] . "</td>";
                              echo "<td>  <img onclick=".'"'."getPage('/core/User/UserUpdate.php?id=".$row['id']."&number=".$row['number']."&email=".$row['email']."&lastname=".$row['lastname']."&name=".$row['name']."&middlename=".$row['middlename']."')".'"'." src='/../images/edit.png' alt='Изменить' width=16 height=16> </td>";
                              echo "<td>  <img onclick=".'"'."Request('user','delete', '".$row['id']."')".'"'." src='/../images/delete.png' alt='Удалить' width=16 height=16> </td>";
                              echo "</tr>";
                            }
	
                ?>                
<?php
echo '
                </tbody>
            </table>
            <hr>
            <input id="button" type="Button"  value="Закрыть" title="закрыть" onclick="getPage('."'".'/core/context/context.html'."'".')">            
            <input id="button" type="Button" onclick="getPage('."'".'/core/User/UserInsert.php'."'".')" value="Создать" title="Создать учетную запись партнера">

    </body>
</html>
';

?>
